package com.lz.jisuan;

import java.util.Scanner;

public class Jisuanqi {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("请输入第一个数：");
		Scanner input = new Scanner(System.in);
		double a = input.nextDouble();
		System.out.println("请输入运算符：");
		char c = input.next().charAt(0);
		System.out.println("请输入第二个数：");
		double b = input.nextDouble();
		switch (c) {
		case '+':
			System.out.println("运算结果：" + "a+b=" + (a + b));

			break;
		case '-':
			System.out.println("运算结果：" + "a-b=" + (a - b));

			break;
		case '*':
			System.out.println("运算结果：" + "a*b=" + (a * b));

			break;
		case '/':
			if (b == 0) {
				System.out.println("除数不能为0");
			} else {

				System.out.println("运算结果：" + "a/b=" + (a / b));
			}

			break;
		case '%':
			
			System.out.println("运算结果：" + "a%b=" + (a % b));
	

			break;

		default:
			System.out.println("请输入数字！！！");
		}

	}

}
